package com.lovo;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class login extends JPanel implements ActionListener {
private Icon log =Util.getIcon("/img/buttonLand.jpg");
private Icon enroll =Util.getIcon("/img/buttonLogin.jpg");
private Test0 frame;
private  JButton jButton =new JButton(log);
    public login(Test0 frame){
        this.frame=frame;
        this.setLayout(null);
        //登录按钮
       jButton.setBounds(324,468,140,50);
        jButton.addActionListener(this);
       this.add(jButton);

       //注册按钮
        JButton jButton1 =new JButton(enroll);
        jButton1.setBounds(494,468,140,50);
        this.add(jButton1);
        //透明的
        this.setOpaque(false);
    }


    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource()==jButton){
            frame.switchPanel("menu");
        }
    }
}
